<?php
/**
 * Created by PhpStorm.
 * User: liu85
 * Date: 2018/11/11
 * Time: 2:00
 */

namespace app\admin\controller;


use think\facade\Request;

class Upload extends Auth
{
    public function upload_file(){
        $file = Request::file('file');
        $filename = $file->getPathName();
        if(!file_exists($filename)){
            _failure('上传失败');
        }
        $fileContents = file_get_contents($filename);
        @unlink($filename);
        _success(['data'=>$fileContents]);
    }
}